<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/eff.css"/>">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/structure.css"/>">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/menu.css"/>">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/table.css"/>">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/search.css"/>">
        <link rel="stylesheet" type="text/css" href="<s:url value="/css/button.css"/>">
        <title>Modifier POI</title>
    </head>
    
    <script type="text/javascript">
    
    function chargerEmplacements(){
	if (document.getElementById("niveau_base").value != "aucun"){
		document.forms["formIndicateur"].action = '<%=request.getContextPath()%>/indicateurCalcules/getEmplacementsValeursModifier.action';
			document.forms["formIndicateur"].submit();
		}
	}
    </script>

<body>
			   <%@ include file="/vues/menu.jsp" %>
	
		<div class="leftmenu">
		<ul id="menu-accordeon">
      <ul>
      <li><a href="<%=request.getContextPath()%>/themes/ListeThemes.action">Liste des thémes</a>
   
   </li>
				<li><a
					href="<%=request.getContextPath()%>/themes/ListeIndicateursCalcule.action?identifiantTheme=<%=request.getParameter("identifiantTheme")%>">Liste des indicateurs
						calculés</a></li>
						
				
			</ul>
		</div>

	<center>
				<form name="formIndicateur" action="<%=request.getContextPath()%>/valeurs/ModifierValeur.action">
				<table cellspacing='0' id="inputText">
                <tbody>
					<tr>
						<td class="evento">Valeur :</td>
						 <td><input type="text" name="valeur" value="<s:property 
						 value="valeur"/>"><div style="color: red;" align="left">
						 <s:fielderror><s:param>valeur</s:param></s:fielderror></div></td>
					</tr>
					<tr>
						<td class="evento">Année :</td>
						 <td><input type="text" name="annee" value="<s:property 
						 value="annee"/>"><div style="color: red;" align="left">
						 <s:fielderror><s:param>annee</s:param></s:fielderror></div></td>
					</tr>
					
				<tr>
				<tr>
						<td class="evento">Niveau de base :</td>

						<td class="evento"><select id="niveau_base"
							name="niveau_base" value='<c:out value="${niveau_base}"/>'
							onchange="chargerEmplacements();">
								<option value="aucun">Choisissez le niveau de base </option>
								<c:if test="${niveau_base == 'region'}">
									<option value="region" selected>Region</option>
								</c:if>
								<c:if test="${niveau_base == 'province'}">
									<option value="province" selected>Province</option>
								</c:if>
								<c:if test="${niveau_base == 'commune'}">
									<option value="commune" selected>Commune</option>
								</c:if>
								<c:if test="${niveau_base == 'poi'}">
									<option value="poi" selected>Poi</option>
								</c:if>
								<c:if test="${niveau_base != 'region'}">
									<option value="region">Region</option>
								</c:if>
								<c:if test="${niveau_base != 'province'}">
									<option value="province">Province</option>
								</c:if>
								<c:if test="${niveau_base != 'commune'}">
									<option value="commune">Commune</option>
								</c:if>
								<c:if test="${niveau_base != 'poi'}">
									<option value="poi">Poi</option>
								</c:if>
						</select></td>
					</tr>
					<tr>
						<td class="evento">Emplacement :</td>
						<td>
						<c:choose>
						<c:when test="${not empty listeEmplacments}">
							<s:select  id="emplacement" name="identifiantEmplacement"  headerKey="idReg"
							listKey="identifiant" listValue="nom"
									 list="listeEmplacments" 
									/> 
						</c:when>
						
					</c:choose>
							</td>
<!-- 					<tr> -->
<!-- 						<td><label>Emplacement :</label></td> -->
						
						
<%-- 						<td><c:choose> --%>
<%-- 								<c:when test="${not empty listeEmplacments}"> --%>
<%-- 									<s:select id="emplacement" name="idemplacement"headerKey="identifiantEmplacement" --%>
<%-- 									 listKey="identifiantEmplacement" listValue="nom" --%>
<%-- 										 list="listeEmplacments" /> --%>
<%-- 								</c:when> --%>
<%-- 								<c:otherwise> --%>

<%-- 									<select > --%>
<!-- 										<option value="aucun">Choisissez l'emplacement</option> -->
<%-- 								</c:otherwise> --%>
<%-- 							</c:choose></td> --%>
<!-- 						<br> -->

<!-- 					</tr> -->
<!-- 				<tr> -->
<!-- 						<td class="evento">Emplacement :</td> -->
<!-- 						<td> -->
<%-- 						<c:choose> --%>
<%-- 						<c:when test="${not empty listeEmplacments}"> --%>
<%-- 							<s:select  id="emplacement" name="identifiantEmplacement"  headerKey="idemplacement" --%>
<%-- 							listKey="identifiant" listValue="nom" --%>
<%-- 									 list="listeEmplacments"  --%>
<%-- 									/>  --%>
<%-- 						</c:when> --%>
						
<%-- 					</c:choose> --%>
<!-- 							</td> -->
						
					</tr>
					
                        <td class="evento" colspan="2"><input class="btnLogin" value="Modifier" type="submit"></td>
					</tr>
					
				 </tbody>
                </table>
					
					<s:textfield cssStyle="display:none;" name="identifiant" value="%{#parameters['identifiant']}"></s:textfield>
					<s:textfield cssStyle="display:none;" name="identifiantTheme" value="%{#parameters['identifiantTheme']}"></s:textfield>
					<s:textfield cssStyle="display:none;" name="identifiantIndicateur" value="%{#parameters['identifiantIndicateur']}"></s:textfield>
					<s:textfield cssStyle="display:none;" name="identifiantEmplacement" value="%{#parameters['identifiantEmplacement']}"></s:textfield>
					
				</form>
				</center>
				
				
				
<s:if test="hasActionErrors()">
						<s:actionerror />
				</s:if>
			
</body>
</html>